home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Kool / Kool.jar / kool / Ball.class (.txt) next >
Encoding:
Java Class File  |  2001-12-24  |  1.1 KB  |  32 lines

  1. package kool;
  2.  
  3. import com.siemens.mp.game.Sprite;
  4. import javax.microedition.lcdui.Image;
  5.  
  6. public class Ball extends Sprite {
  7.    public static int BIG = 0;
  8.    public static int MEDIUM = 1;
  9.    public static int SMALL = 2;
  10.    public int type;
  11.    public int size;
  12.    public int xSpeed;
  13.    public int ySpeed;
  14.  
  15.    public Ball(int pX, int pY, Image ball, Image mask, int pSize, int pXSpeed, int pYSpeed) {
  16.       super(ball, mask, 1);
  17.       ((Sprite)this).setPosition(pX, pY);
  18.       this.size = pSize;
  19.       this.xSpeed = pXSpeed;
  20.       this.ySpeed = pYSpeed;
  21.       this.size = pSize;
  22.       if (this.size == 14) {
  23.          this.type = BIG;
  24.       } else if (this.size == 10) {
  25.          this.type = MEDIUM;
  26.       } else if (this.size == 6) {
  27.          this.type = SMALL;
  28.       }
  29.  
  30.    }
  31. }
  32.